package _19define;
import java.util.Random ;
public class Demo3 {
    public static void main(String[] args) {

        int randomPassword = new Random().nextInt(1000);
        String password = String.format ("%03d", randomPassword);

        for (int i = 0; i < 1000; i++) {
            String candidatePassword = String.format ("%03d", i);
            if (candidatePassword.equals(password)) {
                System.out.println ("匹配到的密码是: " + candidatePassword);
                break;
            }
        }
    }
}
